<!DOCTYPE html>
<html lang="en">
<head th:insert="/admin/common/head::css"></head>
<body>
<div th:insert="/admin/common/header::header" ></div>
<!--  main  -->
<div class="container-fluid">
    <div class="row-fluid">
        <div th:insert="/admin/common/side::side" ></div>
        <!-- content  内容页面的代码放这里 -->
        <div class="block">
            <div class="block-content collapse in">
                <div class="span12">
                    <form class="form-horizontal" method="post" th:action="@{/admin/msg/update}">
                        <fieldset>
                            <legend>通知信息修改</legend>

                            <div class="control-group" th:if="${msg != null}">
                                <label class="control-label">通知序号</label>
                                <div class="controls">
                                    <input readonly="readonly" required type="text" class="input-xlarge datepicker" id="id" name="id" th:value="${msg!=null?msg.id:''}">
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" >活动名称</label>
                                <div class="controls">
                                    <select th:value="${msg != null?msg.aid:''}" name="aid" id="aid" class="form-control1">
                                        <option th:selected="${msg != null ? msg.aid == active.id: ''}" th:each="active:${actives}" th:value="${active.id}" th:text="${active.name}"></option>
                                    </select>
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" >通知内容</label>
                                <div class="controls">
                                    <textarea required type="texteara" class="input-xlarge datepicker" id="content" name="content" th:value="${msg!=null?msg.content:''}">
                                    </textarea>
                                </div>
                            </div>

                            <div class="control-group" th:if="${msg!=null}">
                                <label class="control-label" >通知时间</label>
                                <div class="controls">
                                    <input readonly=readonly type="date" required class="input-xlarge datepicker" id="time" name="time" th:value="${msg!=null?#dates.format(msg.time, 'yyyy-MM-dd'):''}">
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" >发布通知人</label>
                                <div class="controls">
                                    <select th:value="${msg != null?msg.uid:''}" name="uid" id="uid" class="form-control1">
                                        <option th:selected="${msg != null ? msg.uid == user.id: ''}" th:each="user:${users}" th:value="${user.id}" th:text="${user.username}"></option>
                                    </select>
                                </div>
                            </div>


                            <div class="form-actions">
                                <button th:if="${loginUser.userType == 0}" type="submit" class="btn btn-primary"  >[[ ${msg!=null?'更新':'新增'} ]]</button>
                                <a type="button" class="btn btn-warning" th:href="@{/admin/msg/page}">返回</a>
                            </div>
                        </fieldset>
                    </form>

                </div>
            </div>
        </div>
        <!-- content -->
    </div>
</div>
<!--  main  -->

</body>
<div th:insert="/admin/common/footer::js" ></div>
<script type="text/javascript">

    document.getElementById("msg").className = 'active'
</script>
</html>